home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / biz / dopus / DOpusRxTrash.lha / Cestino.dopus5 next >
Text File  |  2001-06-01  |  3KB  |  110 lines

  1. /* Global trashcan for Directory Opus 5.60+
  2.    by Stefano Regattin with the precious help of Dave Clarke
  3.    http://utenti.tripod.it/esseerre/Stefano.html
  4.    e-mail: esseerre@lycos.it
  5.    $VER: Cestino.dopus5 1.0 (1.6.2001)
  6. Assign your birth date to LaMiaDataDiNascita */
  7. LaMiaDataDiNascita=8111966
  8. LF='0a'x
  9. Options Results
  10. Options FailAt 21
  11. Lib='rmh.library'
  12. If ~Show('L',Lib) Then
  13. Do
  14.  If ~AddLib(Lib,0,-30) Then Exit
  15.  If AddLibrary('rexxsupport.library')~=0 Then Exit
  16.  If ~OpenPort(trashport) Then Do
  17.   Say 'Non posso mettere il cestino!'
  18.   Exit
  19.  End
  20.  MenuCestino.count=3
  21.  MenuCestino.0='Ricicla'
  22.  MenuCestino.1='---'
  23.  MenuCestino.2='Elimina'
  24.  Argomento.count=5
  25.  DOpus AddAppIcon trashport "Cestino" LaMiaDataDiNascita icon 'ENVARC:Sys/def_trashcan' close info snap local menu MenuCestino
  26.  Icona=RESULT
  27.  Do Until Uscita=1
  28.   Evento=PortSignal(trashport)
  29.   If CheckSignal(Evento)~=0 Then
  30.   Do
  31.    Pacchetto=GetPkt(trashport)
  32.    If Pacchetto~=Null() Then
  33.    Do
  34.     Do Argomento=0 To 4
  35.      Argomento.Argomento=GetArg(Pacchetto,Argomento)
  36.     End
  37.     Call Reply(Pacchetto,0)
  38.     Select
  39.     When Argomento.0='dropfrom' Then
  40.     Do
  41.      Lister Query Source
  42.      Lista=RESULT
  43.      Lister Query Lista Path
  44.      Percorso=RESULT
  45.      Parse Var Percorso Dispositivo ":" Percorso
  46.      NomeFile=Argomento.2
  47. /*     Parse Var Dispositivo "X" Dispositivo */
  48.      File=Dispositivo":"Percorso||NomeFile
  49.      If Exists(File) Then
  50.      Do
  51.       Address Command 'Copy 'File' 'Dispositivo':Trashcan ALL CLONE'
  52.       Address Command 'Delete 'File''
  53.       DOpus Request '"'File' messo nel cestino" OK'
  54.       IconaFile=File".info"
  55.       If Exists(IconaFile) Then
  56.       Do
  57.        Address Command 'Copy 'IconaFile' 'Dispositivo':Trashcan ALL CLONE'
  58.        Address Command 'Delete 'IconaFile''
  59.        DOpus Request '"'IconaFile' messa nel cestino" OK'
  60.       End
  61.      End
  62.      Lister Refresh Lista
  63.      DOpus Script '"Lasciato sul cestino"'
  64.     End
  65.     When Argomento.0='menu' Then
  66.     Do
  67.      Select
  68.      When Argomento.2=0 Then
  69. /* Change the devices definitions to perform on all trashcans */
  70.      Do
  71.       Do Dispositivo=0 To 6
  72.        Address Command 'Copy DH'Dispositivo':Trashcan/#? RAM: ALL CLONE'
  73.        Address Command 'Delete DH'Dispositivo':Trashcan/#? ALL'
  74.       End
  75.       DOpus Request '"Ho riciclato tutti i file nei cestini in DiscoRAM" OK'
  76.       DOpus Script '"Cestino riciclato"'
  77.      End
  78.      When Argomento.2=2 Then
  79. /* Change the devices definitions to perform on all trashcans */
  80.      Do
  81.       Do Dispositivo=0 To 6
  82.        Address Command 'Delete DH'Dispositivo':Trashcan/#? ALL'
  83.       End
  84.       DOpus Request '"Ho vuotato tutti i cestini" OK'
  85.       DOpus Script '"Cestino vuotato"'
  86.      End
  87.      Otherwise NOP
  88.      End
  89.     End
  90.     When Argomento.0='info' Then
  91.     Do
  92.      DOpus SetAppIcon BUSY ON
  93.      DOpus Request '"by Stefano Regattin with the precious help of Dave Clarke"'LF'"esseerre@lycos.it"'LF'"http://utenti.tripod.it/esseerre/Stefano.html" OK'
  94.      Do Until RC~=0
  95.      End
  96.      DOpus SetAppIcon BUSY OFF
  97.     End
  98.     When Argomento.0='removed' Then Uscita=1
  99.     When Argomento.0='close' Then Uscita=1
  100.     Otherwise NOP
  101.     End
  102.    End
  103.   End
  104.  End
  105.  DOpus RemAppIcon Icona
  106.  DOpus Script '"Cestino rimosso"'
  107.  Call ClosePort(trashport)
  108.  Exit
  109. End
  110.